#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <math.h>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
int removeElement(vector<int>& nums, int val) {
    short size=nums.size();
    short i=0;
    for(short j=0;j<size;j++){
        if(nums[j]!=val){
            nums[i]=nums[j];
            i++;
        }
    }
    return i;

}
int main(){
    vector<int>a={0,1,2,2,3,0,4,2};

cout<<removeElement(a,2)<<endl;

for(auto temp:a){
    cout<<temp<<",";
}
    return 0;
}